<template>
  <div class="navbar">
    <ul>
      <li v-for="(item, index) in navItems" @click.stop="handleClick(index)">
        <img :src="item.src">
        <p>{{ item.title }}</p>
      </li>
    </ul>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        navItems: [
          {
            src: require('../../assets/home_safe@3x.png'),
            title: '安全保障'
          },
          {
            src: require('../../assets/home_new@3x.png'),
            title: '新手指引'
          },
          {
            src: require('../../assets/home_help@3x.png'),
            title: '帮助中心'
          },
          {
            src: require('../../assets/home_us@3x.png'),
            title: '关于分秒'
          }
        ]
      }
    },
    methods: {
      handleClick (index) {
        switch (index) {
          case 0:
            this.$emit('click', '/safeGuarntee')
            break
          case 1:
            this.$emit('click', '/greenHand')
            break
          case 2:
            this.$emit('click', '/helpCenter')
            break
          case 3:
            this.$emit('click', '/aboutFenmiao')
            break
          default:
            break
        }
      }
    }
  }
</script>

<style lang='scss' scoped>
  @import '../../common/scss/_variable.scss';
  .navbar {
    width: 100%;
    height: 200px;
    background: url(../../assets/home_bg01@2x.png) 0 0 no-repeat;
    background-size: cover;
    ul {
      height: 100%;
      display: flex;
      justify-content: space-around;
      align-items: center;
      font-size: 20px;
      color: $base-666;
      text-align: center;
      li {
        flex: 0 1 auto;
        img {
          width: 90px;
        }
        p {
          font-size: 28px;
          color: $base-666;
          margin-top: 30px;
          white-space: nowrap;
        }
      }
    }
  }
</style>
